import { MENUS_PENDING, MENUS_RESOLVE, MENUS_REJECT } from './../constants/menus';

const INITIAL_STATE = {
  menu:{
    // price: 0
  },
  pending: false
}

export default function menus(state = INITIAL_STATE, action) {
  switch(action.type) {
    case MENUS_PENDING:
      return {
        ...state,
        pending: true
      }
      break
    case MENUS_RESOLVE:
      return {
        ...state,
        menu: action.menu,
        pending: false
      }
      break
    case MENUS_REJECT:
      return {
        ...state,
        pending: false
      }
      break
    default:
      return state
      break
  }
}